package com.pz.cloud.framework.material.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pz.cloud.framework.business.material.entity.MaterialApplyDetail;
import com.pz.cloud.framework.business.material.service.IMaterialApplyDetailService;
import com.pz.cloud.framework.material.mapper.MaterialApplyDetailMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
@Transactional
public class MaterialApplyServiceDetailImpl extends ServiceImpl<MaterialApplyDetailMapper, MaterialApplyDetail> implements IMaterialApplyDetailService {


    @Override
    public List<MaterialApplyDetail> findByApplyId(String applyId) {
        LambdaQueryWrapper<MaterialApplyDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MaterialApplyDetail::getApplyId,applyId);
        return this.list(queryWrapper);
    }

    @Override
    public void deleteByApplyId(String applyId) {
        LambdaQueryWrapper<MaterialApplyDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MaterialApplyDetail::getApplyId,applyId);
        this.remove(queryWrapper);
    }
}
